package com.pure.database.greendao

import android.app.Application
import com.pure.database.gen.DaoMaster
import com.pure.database.gen.DaoSession


/**
 * FileName : GreenDaoHelper
 * Author : luqihua
 * Date : 2025/3/20
 * Desc :
 **/

object GreenDaoHelper {
    private lateinit var daoSession: DaoSession

    @JvmStatic
    fun initGreenDaoDatabase(application: Application) {
        val helper = MySQLiteOpenHelper(application, "my-gd-db")
        val db = helper.writableDb
        daoSession = DaoMaster(db).newSession()
    }

    @JvmStatic
    fun getDaoSession(): DaoSession {
        return daoSession
    }
}